#ifndef RPI_MS5611I2C_H
#define RPI_MS5611I2C_H
#include "rpi_i2c.h"
#include <stdint.h>



class ms5611: public rpi_i2c {
    public :
    ms5611(const char *d = "/dev/i2c-1",const char a=0x77,const char r=0x1E);
    ~ms5611();
    
    void acquire();
    double pressure();
    double temperature();
    long getVal(char r);
    void measureAvg(const int a);
    double calcAltitude();
    double knownHeight(double h);
    void setSeaLevelPressure(double p);
    protected:
    
    uint32_t D1 ;
    uint32_t D2 ;
    int64_t dT ;
    int32_t TEMP ;
    int64_t OFF ; 
    int64_t SENS ; 
    int32_t P ;
    uint16_t *C;
    double sea_p;
    long pressure_24i;
    long temperature_24i;
    double pressure_v;
    double temperature_v;
};

#endif // RPI_MS5611I2C_H